package com.xunwulian.dubbo.service.impl;

import com.xunwulian.api.dto.BaseResponse;
import com.xunwulian.api.iface.CardNodeAPI;
import com.xunwulian.base.dao.CardNodeDao;
import com.xunwulian.base.entity.CardNodeEntity;
import com.xunwulian.base.entity.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.alibaba.dubbo.config.annotation.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/3/13.
 */
@Service
public class CardNodeApiImpl implements CardNodeAPI {

    @Autowired
    private CardNodeDao cardNodeDao;

    public CardNodeApiImpl() {
    }

    @Override
    public BaseResponse listPage(Page page,
                                 String appId,
                                 String userId,
                                 String msisdnKey,
                                 String userNameKey) {

        BaseResponse<List<CardNodeEntity>> response = new BaseResponse<>();

        List<CardNodeEntity> cardList = cardNodeDao.listPage(page,
                appId,
                userId,
                msisdnKey,
                userNameKey);

        response.setData(cardList);
        response.setPage(page);

        return response;
    }
}
